﻿<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <!--edge浏览器H5兼容设置-->
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--360浏览器H5兼容设置-->
   <meta name="renderer" content="webkit" />
   <title>停车场登录</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" type="text/css" href="../bootstrap3/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="../bootstrap3/font-awesome-4.7.0/css/font-awesome.css" />
	<script type="text/javascript" src="../bootstrap3/jquery.min.js"></script>
	<script type="text/javascript" src="../bootstrap3/js/bootstrap.js"></script>
	<script type="text/javascript" src="../bootstrap3/js/holder.js"></script>
	<script type="text/javascript" src="../bootstrap3/js/html5shiv.min.js"></script>
	<script type="text/javascript" src="../bootstrap3/js/css3-mediaqueries.js"></script>
	<script type="text/javascript" src="../bootstrap3/js/respond.min.js"></script>
	<!-- 自定义样式 -->
	<link rel="stylesheet" type="text/css" href="../css/login.css" />
</head>
<body>
		<div class="container" id="d1">
			<div class="row">
				<div class="col-md-offset-4 col-md-4">
					<!--登录面板-->
					<div id="d2">
						<!--面板主体-->
						<div class="panel-body">
							<!--登录表单-->
							<form id="form-login" class="form-horizontal" role="form" action="index.html" method="get">
								<!--用户名-->
								<div class="form-group">
									<div class="col-md-12">
										<input type="text" class="form-control" id="adminName" name="adminName" placeholder="请输入账号">
									</div>
								</div>
								<!--密码-->
								<div class="form-group">
									<div class="col-md-12">
										<input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
									</div>
								</div>
								<!--登录按钮-->
								<div class="form-group">
									<div class="col-md-12">
										<button id="btn-login" type="button" class="btn btn-primary sublogin btn-block">登录</button>
									</div>
								</div>
								<!-- <span><a href="forgetPassword.html"
								style="display: block;color:black; float: left; font-size: 14px;border-right:1px solid gray;padding-right:10px;padding-left:170px;"
								>忘记密码</a>
								<a href="reg.html"
								style="display: block;color:black; float: left; font-size: 14px;padding-right:10px;padding-left:10px;"
								>注册账户</a></span> -->
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--网页页脚-->
		<footer>
			<div class="container">
				<div style="text-align: center">
					<h1>中国智能停车场管理平台</h1>
					<b>远程控制-在线预约-在线支付-合理规划</b>
				</div>
			</div>
		</footer>
	<script type="text/javascript">
		$("#btn-login").click(function() {
			$.ajax({
				"url" : "/shiro/login",
				"data" : $("#form-login").serialize(),
				"type" : "post",
				"dataType" : "json",
				"success" : function(json) {
					if (json.state === 2000) {
						alert("登录成功！");
						/*$.cookie("avatar", json.data.avatar, {
							"expires" : 1
						});*/
						location.href = "index.html";
					} else {
						alert("登录失败！" + json.message);
					}
				}
			})
		});
	</script>
</body>

</html>